<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>


			<table>
				<tr>
				<td>	
					<a href=${requestScope.board }>
						<table id="content" border="1">
	<tr>
		<td width="65px">글번호</td>
		<td>제목</td>
		<td width="80px">작성자</td>
		<td width="60">작성일</td>
		<td width="60">조회수</td>
	</tr>
<!-- --------------------------------게시물 목록---------------------------------------------- -->
<!-- 
	게시물의 제목에 링크를 걸어 클릭시 그 글의 상세사항을 볼 수 있도록 한다.
	답변 글들의 제목은 답변의 level만큼 공백을 먼저 주고 답변이라는 것을 표시한다. (여기서는 '→' 사용)
-->	
	<c:forEach items="${requestScope.list }" var="board">
		<tr>
			<td>${board.no }</td>
			<td>
				<c:forEach begin="1" end="${board.relevel }" step="1">
					&nbsp;&nbsp;
				</c:forEach>
				<c:if test="${board.relevel != 0 }">
					→
				</c:if>
				<a href="/tour/board/getContent.do?no=${board.no }&page=${requestScope.pagingBean.currentPage}">
					${board.title }
				</a>
			</td>
			<td>${board.writer }</td>
			<td>${board.writedate }</td>
			<td>${board.viewcount }</td>
		</tr>	
	</c:forEach>
<!-- --------------------------------게시물 목록---------------------------------------------- -->	
</table>
<p>
<!-- --------------------------------페이징 처리---------------------------------------------- -->
<table>
	<tr>
		<td>		
		<c:choose>
			<c:when test="${requestScope.pagingBean.previousPageGroup }">
				<a href="/tour/board/list.do?page=${requestScope.pagingBean.startPageOfPageGroup -1 }">
				◀
				</a>
			</c:when>
			<c:otherwise>
				◀
			</c:otherwise>
		</c:choose>
		<c:forEach begin="${requestScope.pagingBean.startPageOfPageGroup }"
							   end="${requestScope.pagingBean.endPageOfPageGroup }"
							   step="1"
							   var ="i">
			<c:choose>
				<c:when test="${i == requestScope.pagingBean.currentPage }">
					${i }
				</c:when>
				<c:otherwise>
					<a href="/tour/board/list.do?page=${i }">${i }</a>
				</c:otherwise>
			</c:choose>			
		</c:forEach>
		<c:choose>
			<c:when test="${requestScope.pagingBean.nextPageGroup }">
				<a href="/tour/board/list.do?page=${requestScope.pagingBean.endPageOfPageGroup + 1 }">
					▶
				</a>
			</c:when>
			<c:otherwise>
				▶
			</c:otherwise>
		</c:choose>
		
		<td>
	</tr>
</table>
<!-- --------------------------------페이징 처리---------------------------------------------- -->
<c:choose>
<c:when test="${sessionScope.member.custName=='관리자' }">
<input type="button" value="글쓰기" onclick="location.href='/tour/board/write_form.do'">
</c:when>
</c:choose>
<br>
					</a>
				</td>
				</tr>
				
				
			</table>


